package com.saudidentalapp;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Menu;

import com.saudiapp.webservice.Utilities;

public class SplashActivity extends Activity 
{

	
	TimerTask task;
	Timer timer;
	
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        try 
        {
			super.onCreate(savedInstanceState);
			setContentView(R.layout.activity_splash);
			//getDevice();
			timer=new Timer();
			task=new TimerTask() 
			{
				
				@Override
				public void run() 
				{
					finish();
					startActivity(new Intent(SplashActivity.this, TabActivity.class));
					
				}
			};
			
			timer.schedule(task, 3000);
		}
        catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}       
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
    
    void getDevice()
    {
    	Utilities utilities=Utilities.getInstance(SplashActivity.this);
    	DisplayMetrics metrics = new DisplayMetrics();
    	getWindowManager().getDefaultDisplay().getMetrics(metrics);
    	switch(metrics.densityDpi){
    	     case DisplayMetrics.DENSITY_LOW:
    	    	 utilities.showToast("ldpi");
    	                break;
    	     case DisplayMetrics.DENSITY_MEDIUM:
    	    	 utilities.showToast("mdpi");
    	                 break;
    	     case DisplayMetrics.DENSITY_HIGH:
    	    	 utilities.showToast("hdpi");
    	                 break;
    	}
    }
}
